package com.homework.demo2;

import java.util.HashSet;

public class Student {
    private String name;

    private HashSet<Course> courses;


    public Student(String name) {
        this.name = name;
        this.courses = new HashSet<Course>();
    }

    public void addCourse(Course course){
        courses.add(course);
    }

    public void removeCourse(String name){
        courses.removeIf(course -> course.getName().equals(name));
    }

    public String getName() {
        return name;
    }

    public HashSet<Course> getCourses() {
        return courses;
    }
}
